﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TCCHWLib
{
    public class MemoryEntry
    {
        protected object m_Value;
        private bool m_Valid;

        public bool Valid
        {
            get { return m_Valid; }
            set { m_Valid = value; }
        }
         
        public virtual object Value
        {
            get { return m_Value; }
            set { m_Value = value; }
        }

        public MemoryEntry(object value)
        {
            m_Value = value;
        }

        public override string ToString()
        {
            string value = "";
            if (m_Value == null)
                value = String.Format("{0,1}", "  Null Value");
            else
                value = String.Format("{0,1}", "\t" + m_Value);

            string valid = (m_Valid) ? "[V]" : "[I]";

            return String.Format(" {0,-16}\t{1}", value, valid);
        }
        
    }
}
